import request from '@/utils/request'

/**
 * 分页查询品牌列表
 */
export function listBrandByPage(pageQuery) {
  return request({
    url: '/service-goods/brand/page/category/brand',
    method: 'GET',
    params: {
      key: pageQuery.key,
      currentPage: pageQuery.currentPage,
      pageSize: pageQuery.pageSize,
      orderField: pageQuery.orderField
    }
  })
}

/**
 * 根据商品分类查询品牌
 */
export function listBrandsByCategoryId(categoryId) {
  return request({
    url: 'service-goods/brand/category/' + categoryId,
    method: 'GET'
  })
}

/**
 * 保存商品分类
 */
export function saveBrand(data) {
  return request({
    url: '/service-goods/brand/saveWithCategory',
    method: 'POST',
    data
  })
}
